package utils

import (
	"fmt"
	"runtime/debug"
)

// Throw 抛出错误
func Throw(err error) {
	if err != nil {
		panic(err)
	}
}

// ExceptionCatch 捕获错误并recover
func ExceptionCatch() {
	if err := recover(); err != nil {
		fmt.Printf("Exception：%v \n %s", err, string(debug.Stack()))
	}
}
